<?php
// header('content-type:text/html;charset=utf-8');
$tel=$_REQUEST['tel'];
$yz=$_REQUEST['yz'];

include('./1conn.php');
$select="select*from users where tel='$tel'";
// echo $select;
$res=$conn->query($select);
if($res->num_rows>0){
    echo'<script>alert("用户已注册,请直接登录");</script>';
    echo'<script>location.href="../src/login.html";</script>';
    die();
}
$work="insert into users (username,password,sex,tel,address,age) value('','',1,'$tel','',1)";
echo $work;
$work=$conn->query($work);
// echo $work;
if($work){
    echo'<script>alert("注册成功");</script>';
    echo'<script>location.href="../src/index.html";</script>';
}
?>